//
//  DropdownMenu.h
//  Common
//
//  Created by Ryan Wong on 15/9/9.
//  Copyright (c) 2015年 tenfoldtech. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DropdownButton.h"
#import "ConditionDoubleTableView.h"

@protocol dropdownDelegate <NSObject>

@optional
/**
 *  代理方法 返回选中的下表以及按钮
 *
 *  @param index 按钮索引
 *  @param left  左边列表选中index  没有则返回0
 *  @param right 右边选中index
 */
- (void)dropdownSelectedButtonIndex:(NSString *)index LeftIndex:(NSString *)left RightIndex:(NSString *)right;

@end

@interface DropdownMenu : UIViewController<showMenuDelegate, ConditionDoubleTableViewDelegate> {
    DropdownButton *_button;
    ConditionDoubleTableView *_tableView;
    NSInteger _lastIndex;
    
    NSInteger _buttonSelectedIndex;//选中的button索引
    NSMutableArray *_buttonIndexArray;//button索引数组
    
    NSArray *_titles;
    NSArray *_leftArray;
    NSArray *_rightArray;
}

@property (assign, nonatomic) id<dropdownDelegate>delegate;

//初始化菜单

- (id)initDropdownWithButtonTitles:(NSArray*)titles andLeftListArray:(NSArray*)leftArray andRightListArray:(NSArray *)rightArray;

@end
